#ifndef CALC_H
#define CALC_H

#include <iostream>
#include <string>
using namespace std;

class Calc
{
private:
    int firstNum, secondNum, result;
    string firstNumStr="0", secondNumStr="0";
    bool firstInput = true;

public:
    string inputNum(int inputNum)
    {
        cout<<"input"<<endl;
        string newNum;
        if (inputNum == -1) newNum = "00";
        else newNum = to_string(inputNum);
        if (firstInput)
        {
            firstNumStr += newNum;
            return "# " + firstNumStr;
        }
        else
        {
            secondNumStr += newNum;
            return "# " + secondNumStr;
        }
    }
    string calcNum(const int &calcKind)
    {
        firstInput = false;
        cout<<firstNumStr<<" "<<secondNumStr<<endl;
        firstNum = stoi(firstNumStr);
        secondNum = stoi(secondNumStr);
        switch (calcKind)
        {
            case 1: firstNum += secondNum;
            case 2: firstNum -= secondNum;
            case 3: firstNum *= secondNum;
            case 4: firstNum /= secondNum;
            default: break;
        }
        firstNumStr = to_string(firstNum);
        secondNumStr = "";
        return "# " + firstNumStr;
    }
    string clear()
    {
        firstInput = true;
        firstNumStr = "0";
        secondNumStr = "0";
        return "# 0 ";
    }
};

#endif // CALC_H
